var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var UI_UnlockNewEquip_UIBindings = require("AA_UI_UnlockNewEquip_UIBindings");
var UIView = require("AA_UIView");
var BundleConfig = require("AA_BundleConfig");
var AudioManager = require("AA_AudioManager");
var Excel = require("AA_Excel");
var HallGlobalVariable = require("AA_HallGlobalVariable");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_UnlockNewEquip = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.auto_ui = null;
    t.iconSpriteFrame = [];
    return t;
  }
  __extends(_creator, e);
  _creator.prototype._show = function (e) {
    this.shuiGuoIds = e.shuiGuoIds;
    this.clickCallBack = e.callBack;
    this.ShowOne(this.shuiGuoIds.shift());
    this.auto_ui.node_guang.stopAllActions();
    this.auto_ui.node_guang.runAction(cc.repeatForever(cc.rotateBy(5, 360)));
  };
  _creator.prototype.ShowOne = function (e) {
    var t = this;
    AudioManager.AudioMgr.playEffect("audio/effect/getReward");
    this.auto_ui.node_view.scale = 0;
    this.auto_ui.node_view.runAction(cc.scaleTo(.5, 1, 1));
    this.auto_ui.node_titleNode.children.forEach(function (e) {
      e.active = false;
    });
    switch (e) {
      case HallGlobalVariable.default.shangZhenId:
        this.auto_ui.node_titleNode.children[1].active = true;
        this.auto_ui.sp_iconSprite.spriteFrame = this.iconSpriteFrame[0];
        this.auto_ui.txt_nameLabel.string = "上阵位";
        break;
      case HallGlobalVariable.default.wuJinId:
        this.auto_ui.node_titleNode.children[2].active = true;
        this.auto_ui.sp_iconSprite.spriteFrame = this.iconSpriteFrame[1];
        this.auto_ui.txt_nameLabel.string = "无尽模式";
        break;
      default:
        this.auto_ui.node_titleNode.children[0].active = true;
        this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/player/player" + (e - 1e3) + "_1", cc.SpriteFrame).then(function (e) {
          t.auto_ui.sp_iconSprite.spriteFrame = e;
        });
        var o = Excel.Excel.shuiguo(e);
        this.auto_ui.txt_nameLabel.string = "" + o.name;
    }
  };
  _creator.prototype._clickListener = function (e) {
    switch (e) {
      case this.auto_ui.btn_mengban:
        if (this.shuiGuoIds.length > 0) {
          this.ShowOne(this.shuiGuoIds.shift());
        } else {
          this.clickCallBack && this.clickCallBack();
          this._close();
        }
    }
  };
  __decorate([_property(UI_UnlockNewEquip_UIBindings.default)], _creator.prototype, "auto_ui", undefined);
  __decorate([_property([cc.SpriteFrame])], _creator.prototype, "iconSpriteFrame", undefined);
  return __decorate([_ccclass], _creator);
}(UIView.default);
exports.default = _def_UI_UnlockNewEquip;